package o;

import android.content.Context;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView.j;
import androidx.recyclerview.widget.RecyclerView.q.e;
import androidx.recyclerview.widget.RecyclerView.t;
import com.huawei.hms.support.api.entity.hwid.HwIDConstant.ReqAccessTokenParm;
import kotlin.Metadata;
import org.jetbrains.annotations.NotNull;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J \u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0002J\u0012\u0010\r\u001a\u0004\u0018\u00010\f2\u0006\u0010\u0007\u001a\u00020\bH\u0002J \u0010\u000e\u001a\u00020\u000f2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0013H\u0014¨\u0006\u0014"}, d2 = {"Lcom/huawei/appgallery/foundation/ui/framework/fragment/multitabs/CentralLinearSmoothScroller;", "Landroidx/recyclerview/widget/LinearSmoothScroller;", "context", "Landroid/content/Context;", "(Landroid/content/Context;)V", "distanceToCenter", "", "layoutManager", "Landroidx/recyclerview/widget/RecyclerView$LayoutManager;", "targetView", "Landroid/view/View;", "helper", "Landroidx/recyclerview/widget/OrientationHelper;", "getOrientationHelper", "onTargetFound", "", "state", "Landroidx/recyclerview/widget/RecyclerView$State;", "action", "Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;", "HiAppBase_release"}, k = 1, mv = {1, 1, 15})
public final class ciw extends mh {
    public ciw(@NotNull Context context) {
        fsd.ˊ(context, "context");
        super(context);
    }

    public void ˋ(@NotNull View view, @NotNull t tVar, @NotNull e eVar) {
        fsd.ˊ(view, "targetView");
        fsd.ˊ(tVar, ReqAccessTokenParm.STATE_LABEL);
        fsd.ˊ(eVar, "action");
        j ˏ = ˏ();
        if (ˏ != null) {
            fsd.ॱ(ˏ, "layoutManager ?: return");
            mq ˋ = ˋ(ˏ);
            if (ˋ != null) {
                int ˏ2 = ˏ(ˏ, view, ˋ);
                if (ˏ.ʼ()) {
                    eVar.ˏ(0, ˏ2, 200, this.ˎ);
                } else {
                    eVar.ˏ(ˏ2, 0, 200, this.ˎ);
                }
            }
        }
    }

    private final int ˏ(j jVar, View view, mq mqVar) {
        int ˏ;
        int ˊ = (mqVar.ˊ(view) / 2) + mqVar.ˋ(view);
        if (jVar.ʿ()) {
            ˏ = mqVar.ˏ() + (mqVar.ʻ() / 2);
        } else {
            ˏ = mqVar.ॱ() / 2;
        }
        return ˊ - ˏ;
    }

    private final mq ˋ(j jVar) {
        if (jVar.ʼ()) {
            return mq.ˋ(jVar);
        }
        if (jVar.ʻ()) {
            return mq.ˏ(jVar);
        }
        return null;
    }
}
